/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Date:2025-01-25
 * Time:23:45
 */
public class Demo6 {
    public static void main(String[] args) throws InterruptedException {
        Object object=new Object();
        synchronized (object){
            System.out.println("wait之前！");
            //要把wait放到synchronized里面来调用，要保证确实是拿到了锁的
            object.wait();
            System.out.println("wait之后！");
        }
    }
}
